home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13957 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  33 lines

  1. Newsgroups: comp.lang.c
  2. Path: netcom.com!smryan
  3. From: smryan@netcom.com (@#$%!?!)
  4. Subject: Re: Largest effective integer.
  5. Message-ID: <smryanDpnDDn.418@netcom.com>
  6. Organization: The Programmer formerly known as S M Ryan
  7. X-Newsreader: TIN [version 1.2 PL1]
  8. References: <4ke5gu$o7u@airdmhor.gen.nz>
  9. Date: Wed, 10 Apr 1996 12:58:35 GMT
  10. Sender: smryan@netcom3.netcom.com
  11.  
  12. :   What's the highest unsigned value you can safely represent without losing
  13. : integer accuracy using an ANSI defined type?  For example you can get as
  14. :
  15. :   Basically I want a really big unsigned int and I don't care what format
  16. : it's in or how slow it is.
  17.  
  18. Measly little 32 bit integers and reals. I grew up on 60 and 48 bit integers,
  19. 120 bit doubles. And 65535 bit integers.
  20.  
  21. In other words, this all machine specfic. Look in <limits.h> if your
  22. compiler has one. With proper abuse of cpp and opaque types, you can
  23. make your own abstract integer type which should be fairly portable.
  24.  
  25. If you really don't care how slow, you can implement it as array
  26. of bytes and do the arithmetic one byte at a time, propogating carries,
  27. etc.
  28. -- 
  29. The Queen, amused, in quiet power,         | smryan@netcom.com  PO Box 1563
  30. will draw the son to darkenned bower.      |          Cupertino, California
  31. Her face is fair, her fragrance rare,      | (xxx)xxx-xxxx            95015
  32. with woven webs for wayward flower.        |         I don't use no smileys
  33.